package com.ssyt.ssh.sys.dao.impl;

import java.util.Date;

import org.springframework.stereotype.Repository;

import com.ssyt.ssh.common.BaseDao;
import com.ssyt.ssh.sys.dao.LogDao;
import com.ssyt.ssh.sys.entity.Log;

@Repository
public class LogDaoImpl extends BaseDao<Log, Integer> implements LogDao {

	// @Override
	public void addLog() {
		// service层做事务，Dao层返回Exception?还是RuntimeException？
		// RuntimeException
		// System.out.println(1 / 0);
		// if (true) {
		// throw new Exception();
		// }
		try {
			Log log = new Log();
			log.setLog("新增了一个用户");
			log.setCreateTime(new Date());
			save(log);
			System.out.println("Log added!");
		} catch (Exception e) {
			throw new RuntimeException();
		}
	}
}
